package com.ibeeking.found.msg.service.common.constants;

import com.ibeeking.found.common.enums.mp.WxMpEventTypeEnum;

/**
 * @Author ibeeking
 * @Date: 2021-01-05 19:15
 * @Description: 或且enum
 */
public enum MessageEventEnum {

    SUBSCRIBE("subscribe"),

    KEY("key"),

    NO_KEY("noKey"),
    ;

    private String type;

    MessageEventEnum(String type) {
        this.type = type;
    }

    public String getEventType() {
        return type;
    }

    public static WxMpEventTypeEnum getEnum(String type) {
        for (WxMpEventTypeEnum eventTypeEnum : WxMpEventTypeEnum.values()) {
            if (eventTypeEnum.getEvenType().equals(type)) {
                return eventTypeEnum;
            }
        }
        return null;
    }
}
